<template>
	<div>
		<h1>作品上传</h1>
		title <input type="text" v-model="title"> <br>
		auther <input type="text" v-model="auther"> <br>
		video <textarea name="" id="" cols="30" rows="10" v-model="video"></textarea>
		<!-- video <div class="photo1" ><input type="file" @change="change1"></div> -->
		<!-- touxiang <div class="photo2"><input type="file" @change="change2"></div> -->
		commit <textarea name="" id="" cols="30" rows="10" v-model="text"></textarea>
		头像 <textarea name="" id="" cols="30" rows="10" v-model="touxiang"></textarea>
		zhuti <textarea name="" id="" cols="30" rows="10" v-model="zhuti"></textarea>
		uid <textarea name="" id="" cols="30" rows="10" v-model="uid"></textarea>
		<h1>{{zhuti}}</h1>
		<el-button type="success" @click="sub1">提交</el-button>
	</div>
</template>

<script setup>
	import {ref,getCurrentInstance} from "vue"
	let {proxy} = getCurrentInstance();
	let video =ref("")
	// let video02=null
	let touxiang =ref("")
	let title = ref("")
	let text = ref("")
	let auther=ref("")
	let zhuti = ref("")
	let uid = ref("")
	
	let sub1 = async () => {
		let res = await proxy.$axios.post("/egg/zuopinxinxi", {
			    video:video.value,
				title: title.value,
				comment: text.value,
				auther:auther.value,
				avatar:touxiang.value,
				zhuti: zhuti.value,
				uid:uid.value
		})

		if (res.data.code == 2008) {
			alert("成功")
		}
	}
</script>

<style scoped>
   .photo1 {
	width: 100px;
	height: 100px;
	background-image: v-bind(video02);
   }
   .photo2 {
	width: 100px;
	height: 100px;
	background-image: v-bind(touxiang);
   }
</style>